From 53ffebed1953f888c0aaedbc9564f7c6a3cf8805 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Date: Thu, 28 Oct 1999 00:34:59 +0000 Subject: [PATCH] Sync to laptop - Federico --- gdk/gdkpixbuf-render.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index 674da391ba..3f02f69362 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -132,6 +132,7 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, GdkDrawable *drawable, ArtPixBuf *apb; ArtIRect dest_rect, req_rect, area_rect; GdkBitmap *bitmap; + GdkGC *gc; g_return_if_fail (pixbuf != NULL); apb = pixbuf->art_pixbuf; @@ -144,6 +145,23 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, GdkDrawable *drawable, g_return_if_fail (src_x >= 0 && src_x + width <= apb->width); g_return_if_fail (src_y >= 0 && src_y + height <= apb->height); + gc = gdk_gc_new (drawable); + + if (apb->has_alpha) { + /* Right now we only support GDK_PIXBUF_ALPHA_BILEVEL, so we + * unconditionally create the clipping mask. + */ + + bitmap = gdk_pixmap_new (NULL, width, height, 1); + gdk_pixbuf_render_threshold_alpha (pixbuf, bitmap, + src_x, src_y, + 0, 0, + width, height, + alpha_threshold); + + gdk_gc_set_clip_mask (gc, bitmap); + gdk_gc_set_clip_origin (gc, dest_x, dest_y); + } + - bitmap = gdk_pixmap_new (NULL, width, height, 1); } -- 2.30.2